<?php
/**
 * Project: firework-cms             >>  http://firework-cms.googlecode.com
 * Authors: YouniS Ben Salah  (-.-)  >>  http://younishd.kegtux.org
 *          Fabien Wang       (^.^)  >>  http://fabienwang.fr
 * License: See README and LICENSE in the top level directory
 */
/**
 * Snippet: top_menu ( generic )
 * Required data:
 *      + screenname
 *      + home
 *      + elements ( PDOStatement object )
 *          + elements::link
 *          + elements::text
 */
?>
<header>
    <span id="name"><a href="<?php echo $this->data['home'];?>"><?php echo $this->data['screenname']; ?></a></span>
    <nav id="top_menu">
        <ul>
        <?php
        $i = 1;
        $total = $this->data['elements']->rowCount();
        while( $each = $this->data['elements']->fetch() ) {
            if ($each['target'] <> '') {
                echo '<li><a href="' . $each['link'] . '" target="'.$each['target'].'">' . $each['text'] . '</a></li>';
            }
            else {
                echo '<li><a href="' . $each['link'] . '">' . $each['text'] . '</a></li>';
            }
            if ( $i < $total ) {
                echo '<li>&nbsp;&middot;&nbsp;</li>';
            }
            $i++;
        }
        ?>
        </ul>
    </nav>
</header>
<?php
